The content explains the generation of transaction receipts for successful and failed transactions.
Transaction Receipts: Transactions return receipts indicating success or failure. Failed receipts are generated without transaction execution.Successful Transaction Response: A successful transaction provides a SentTransactionResponse. Always verify this response with the isSentTransactionResponse type guard before accessing the transaction hash.
An In-Game Wallet pre-empts failing transactions by simulating them on the network before actual submission. If the simulation fails, the transaction is not sent, and a FailedTransactionResponse is returned.
Copy
Ask AI
import { Sequence, isSentTransactionResponse } from "@0xsequence/waas";const waas = new SequenceWaaS( { projectAccessKey: `${process.env.PROJECT_ACCESS_KEY}`, waasConfigKey: `${process.env.WAAS_CONFIG_KEY}`, network: "arbitrum-nova", });await waas.signIn({ idToken }, "Session name");const tx = await waas.sendTransaction({ chainId: 137, transactions: [ { // This address always fails on Polygon, give it a try :D to: "0x839eE023B21f4Ffe2294025DE0AC30Ba7278D6Fd", value: "0", }, ],});if (isSentTransactionResponse(tx)) { // ... This will never be executed} else { // tx can only be `SentTransactionResponse` or `FailedTransactionResponse` console.log(tx);}